

<?php
    

    function course_availability($course_selected){
        
        $course_available =0;
        
        
        $course_list = file_get_contents('http://en.wikipedia.org/wiki/List_of_programming_languages');
        $course = "|\\b$course_selected\\b|i";
        
        if (@preg_match($course,$course_list)){
            //echo "course is available";
            $course_available = 1;
        }
        else {
            //echo "Invalid course";
            $course_available= 0;
        }
        
        return $course_available;
        
    }
        
    ?>



